
package picturemouse;

import java.io.Serializable;
import java.util.Date;

/**
 * Review class contains free-text film reviews submitted by customers.  Records
 * customer name, film name, and submission date and time when a review is 
 * submitted.  Allows for reviews to be edited, and stores the date and time of
 * the most recent edit, but this functionality should only be exposed to 
 * administrators.
 *
 * @author Group D
 */
public class Review implements Serializable {
    
	private final String customerName;
	private final String filmName;
	private final String submissionDateTime;
	private String reviewText;
	private String modifiedDateTime;
	
    /**
    * Constructor for review objects. Note, this is the only constructor, blank
    * reviews cannot be created.
    * 
    * @param	cName		Name of customer submitting review
    * @param	fName		Title of film being reviewed
    * @param	content		Main body of review
    */
    public Review(String cName, String fName, String content) {
		customerName = cName;
		filmName = fName;
		reviewText = content;		
		submissionDateTime = new Date().toString();
	}
	
    /**
    * Method to change the contents of a review.  This functionality should
    * ONLY be accessible to administrators.
    * 
    * @param	newContents	The new text to replace the main review body
    */
    public void modifyReview(String newContents) {
		reviewText = newContents;
		modifiedDateTime = new Date().toString();
	}
	
	
	//Public getter methods
	
	public String getReviewContents() {
		return reviewText;
	}
	
	public String getSubmitterName() {
		return customerName;
	}
	
	public String getFilmName() {
		return filmName;
	}
	
	public String getSubmissionTime() {
		return submissionDateTime;
	}
	
	public String getModifiedTime() {
		return modifiedDateTime;
	}
	
	
}
